﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PulseApp
{
	/// <summary>
	/// Interaction logic for Index.xaml
	/// </summary>
	public partial class Index : Page {

        Person person;
		public Index() {
			InitializeComponent();
            Person aPerson = CommonResources.Instance.getPerson();
            if (aPerson != null)
            {
                this.person = aPerson;
                this.welcomeLabel.Content = "Welcome " + person.FirstName;
            }
            
		}

        public Index(Person person)
        {
            InitializeComponent();
            this.person = person;
            this.welcomeLabel.Content = "Welcome " + person.FirstName;
        }

		private void button1_Click(object sender, MouseButtonEventArgs e) {
			NavigationService.Navigate(new Uri("Page1.xaml", UriKind.Relative));
		}

		private void button2_Click(object sender, MouseButtonEventArgs e) {
            if (CommonResources.Instance.getPerson() != null)
            {
                NavigationService.Navigate(new Uri("Page2.xaml", UriKind.Relative));
            }
		}

        private void button3_Click(object sender, MouseButtonEventArgs e)
        {
            if (CommonResources.Instance.getPulseWave() != null)
            {
                NavigationService.Navigate(new Uri("Page3.xaml", UriKind.Relative));
            }
        }

        private void button4_Click(object sender, MouseButtonEventArgs e)
        {
            if (CommonResources.Instance.getPerson() != null)
            {
                NavigationService.Navigate(new Uri("Page4.xaml", UriKind.Relative));
            }
        }

        private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {

        }

        private void Image_ImageFailed_1(object sender, ExceptionRoutedEventArgs e)
        {

        }


        

	}
}
